<admintpl file="header" />
<style>
    a{cursor: pointer;}
    .fl{float:left;}
    .c-pages{padding:20px 0; text-align: center;}
    .c-pages.tl{text-align: left;}
    .c-pages span{display: inline-block; margin-right: 5px; font-size:12px; height:28px; line-height: 28px;}
    .c-pages span.col{color: #fe344e; font-weight: 600;}
    .c-pages span a{display: inline-block; margin:0 3px; height:28px; line-height: 28px; text-align: center; padding:0 12px; border:1px solid #ccc; text-decoration: none; border-radius: 2px;}
    .c-pages span a:link,.c-pages span a:active,.c-pages span a:visited{color: #333;}
    .c-pages span a:hover{ color: #157efb; border: 1px solid #157efb;}
    .c-pages span a.active{color: #fff; background: #157efb; border:1px solid #157efb;}
    .c-pages  .current{ color: #fff; background: #157efb; border: 1px solid #157efb; display: inline-block; margin: 0 3px; height: 28px;
        line-height: 28px;
        text-align: center;
        padding: 0 12px;
        text-decoration: none;
        border-radius: 2px;
    }
    div{
        margin-bottom: 20px;
    }
    .txt{
        margin-right: 100px;
    }

    .addWei{background: none; border:1px solid #ff8540; color: #ff8540; padding:4px 6px; font-size: 14px;float:right;margin-left:80px;margin-top:4px;}
    .t1{
        margin-left: 45px;

    }

</style>
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">

    <div style="margin: 50px">
        风格标签：
         <foreach name="data" item="v">
             <input type="text" name="name" id="name" value="{$v.lable}" readonly="readonly" style="width: 100px;background: orange;color: white;border: 1px solid orange;margin-left: 20px;text-align: center">
             <img src="__PUBLIC__/images/timg.png" style="width: 20px;height: 20px;margin:-45px 0 0 -15px" onclick="shanchu({$v.id})">
         </foreach>
        <button type="button" id="open" style="background: white;width: 120px;margin-left: 100px;height: 30px;border: 1px solid orange;color: orange">+添加风格标签</button>

        <form action="{:U('Biaoqian/fengge_biaoqian')}" method="post" class="form-horizontal js-ajax-forms" enctype="multipart/form-data" id="form">
        <div id="cover" style="display: none;position: fixed;width: 100%;height: 100%;top:0px;left:0px;background-color: lightgrey;opacity:0.9">    <!-- 通过遮罩层遮住背景 -->
            <div style="width: 500px;height: 80px;background: white;border:1px solid lightgrey;text-align: center;line-height:80px" id="toast">     <!-- 设置display属性为none以隐藏内容       -->
                　　<span>标签名称</span><input type="text" id="name1" name="name" style="margin-left: 20px">
                　  <button type="button" id="close">确认添加</button>
            </div>
        </div>
        </form>
    </div>
</div>
</body>
</html>

<script src="public/js/laydate/laydate.js"></script>


<script type="text/javascript">
    function shanchu(id){
        window.location.href='index.php?g=Admin&m=Biaoqian&a=fengge_biaoqian_delete&id='+id;
    }
    var toast = document.getElementById("toast");
    var cover = document.getElementById("cover");
    document.getElementById("open").onclick = function(e){      <!--  定义点击事件显示隐藏内容     -->
        cover.style.display = "block";
        toast.style.position = "fixed";
        var winWidth = window.innerWidth;
        var winHeight = window.innerHeight;
        var targetWidth = toast.offsetWidth;
        var targetHeight = toast.offsetHeight;
        toast.style.top = (winHeight - targetHeight) / 2 + "px";
        toast.style.left = (winWidth - targetWidth) / 2 + "px";
    }
    document.getElementById("close").onclick = function(e){        <!--   将显示的内容再次隐藏     -->
        cover.style.display = "none";
        var name1=$("#name1").val();
            if(name1==""){
                alert('标签不能为空');
                return false;
            }
        $("#form").submit();
    }





</script>

